package cn.wolfcode.luowowo.acticle.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

/**
 * 问答查询对象
 */
@Setter
@Getter
public class QuestionAndAnswerQuery extends QueryObject {

    private Long destId = -1L;

    private  int state = -1; //问答状态

    private int orderType = -1; //排序类型

    private String keyword;

    public String getKeyword() {
        return keyword != null ? keyword : null;
    }

    //排序
    public String getOrderBy(){
        if(orderType == 0){
            return " qaa.replynum desc";  //最热
        }else if(orderType == 3){
            return " qaa.questionTime desc "; //最新
        }
        /*else if(orderType == 2){
            return " ";  //未回答
        }*/
        return " qaa.replynum desc";
    }




}